package persistence;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Set;


/**
 * The persistent class for the Service database table.
 * 
 */
@Entity
public class Service implements Serializable {
	private static final long serialVersionUID = 1L;
	private int idService;
	private String serviceName;
	private Set<Firm> firms;

    public Service() {
    }


	@Id
	public int getIdService() {
		return this.idService;
	}

	public void setIdService(int idService) {
		this.idService = idService;
	}


	@Column(name="ServiceName")
	public String getServiceName() {
		return this.serviceName;
	}

	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}


	//bi-directional many-to-many association to Firm
    @ManyToMany
	@JoinTable(
		name="Firm_has_Service"
		, joinColumns={
			@JoinColumn(name="Service_idService")
			}
		, inverseJoinColumns={
			@JoinColumn(name="Firm_crd", referencedColumnName="crd"),
			@JoinColumn(name="Firm_idFirm", referencedColumnName="idFirm")
			}
		)
	public Set<Firm> getFirms() {
		return this.firms;
	}

	public void setFirms(Set<Firm> firms) {
		this.firms = firms;
	}
	
}